#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include<stdbool.h>
#include <string.h>

void Test1()
{
	char c[80], c1 = 'a';
	gets(c);
	int sum = 0;
	// size_t size = sizeof(c) / sizeof(c[0]);
	 size_t size = strlen(c);
	for (int i = 0; i < size; i++)
	{
		if (c[i] == c1)
			sum++;
	}

	printf("sum = %d, size = %zd\n", sum, size);
	
}

#define N 30
void Test2()
{
	
	int a[N] = { 10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,29,28,27,26,25,24,23,22,21,20 };

	for (int i = 0; i < N - 1; i++)
	{
		int _min = a[i], z = i;
		for (int j = i + 1; j < N; j++)
		{
			if (a[j] < _min)
			{
				_min = a[j];
				z = j;
			}
		}
		if (z > i)
		{
			a[z] = a[i];
			a[i] = _min;
		}
	}

	for (int i = 0; i < N; i++)
	{
		printf("%d ", a[i]);
	}
}

int main()
{
	Test2();

	return 0;
}